package 实践.class_03;

import java.util.Scanner;

public class Demo_04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] matrix = new int[4][4];

        // 读取矩阵输入
        for (int i = 0; i < 4; i++) {
            String[] line = sc.nextLine().split(" ");
            for (int j = 0; j < 4; j++) {
                matrix[i][j] = Integer.parseInt(line[j]);
            }
        }
        int sqSum = 0,domSum = 0,subSum = 0,sum = 0;
        for (int i = 0; i < 4; i++) {
            domSum += matrix[i][i];
            subSum += matrix[i][3 - i];
            for (int j = 0; j < 4; j++) {
                sum += matrix[i][j];
            }
        }
        sqSum=sum-matrix[1][1]-matrix[1][2]-matrix[2][1]-matrix[2][2];
        System.out.println(sqSum);
        System.out.println(domSum);
        System.out.println(subSum);
    }
}
